//配置路由表
import { UserOutline,MessageOutline,TextOutline,AppstoreOutline,LoopOutline} from 'antd-mobile-icons'
import React from "react";
import { Navigate } from "react-router-dom";
let Home = React.lazy(() => import("../pages/home/Index"));
let Login = React.lazy(() => import("../pages/login/Index"));
let City = React.lazy(() => import("../pages/city/Index"));
let My = React.lazy(() => import("../pages/my/Index"));
let Layout = React.lazy(() => import("../pages/layout/Index"));
let News = React.lazy(() => import("../pages/news/Index"));
let XingCheng = React.lazy(() => import("../pages/xingcheng/Index"));
let House = React.lazy(() => import("../pages/house/Index"));


let XingCheng2 = React.lazy(() => import("../pages/go/Index"));
let Order = React.lazy(() => import("../pages/order/Index"));
let Train = React.lazy(() => import("../pages/train/Index"));


export const tabBarRoutes = [
  {
    path: "/home",
    element: <Home />,
    title:'首页',
    icon:<AppstoreOutline />
  },
  {
    path: "/house",
    element: <House />,
    title:'社区',
    icon:<LoopOutline />
  },
   {
    path: "/news",
    element: <News />,
    title:'消息',
    icon:<MessageOutline />
  },
    {
    path: "/xingcheng",
    element: <XingCheng />,
    title:'行程',
    icon:<TextOutline />
  },
   {
    path: "/my",
    element: <My />,
    title:'我的',
    icon:<UserOutline />
  },
  
];



let routes = [
  {
    path: "/",
    element: <Layout />,
    children: [
      ...tabBarRoutes,
      {
        path: "/",
        element: <Navigate to="/home"></Navigate>,
      },
    ],
  },
  {
    path: "/login",
    element: <Login />,
  },
   {
    path: "/city",
    element: <City />,
  },

  {
    path: "/train",
    element: <Train />,
    title:'火车首页',
    icon:<AppstoreOutline />
  },
   {
    path: "/xingcheng2",
    element: <XingCheng2 />,
    title:'行程管家',
    icon:<MessageOutline />
  },
    {
    path: "/order",
    element: <Order />,
    title:'我的订单',
    icon:<TextOutline />
  },
 
];

export default routes;
